package com.ebelter.bodyfatscale.ui.pager.main;

import android.app.Activity;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;

import butterknife.ButterKnife;

/**
 * 设备绑定页页面父类
 */
public abstract class BasePagerMain {

    public static final String TAG = "BasePagerBind";

    public Context mContext;
    public View mRootView;// 布局对象

    protected LayoutInflater lf;


    private Activity activity;
    public BasePagerMain(Activity context) {
        activity=context;
        this.mContext = context;
        lf = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
        mRootView = lf.inflate(loadLayoutById(), null);
        ButterKnife.bind(this,mRootView);


        initViews();
    }

    protected int loadLayoutById() {
        return 0;
    }



    /**
     * 初始化布局
     */
    public abstract void initViews();

    public abstract void initData(Object data);


    /***
     * 无数据默认加载
     */
    public void loadViews() {

    }


    public Activity getActivity(){
        return activity;
    }

    public abstract void switchUnitUpdate();



}
